package com.octopus.optiworks.model;

import java.io.Serializable;
import java.util.Date;
import java.util.Set;

import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Column;
import javax.persistence.Transient;

import org.hibernate.annotations.Index;

@SuppressWarnings("serial")
@Entity
@Table
public class ProductArchive implements Serializable{
	
	private Long id;
	
	private String processId;
	
	private String status;
	
	private String lockedBy;
	
	private Template template;
	
	private Long stepSpecId;
	
	private StepSpec stepSpec;
	
	private String lot;
	
	private String wono;
	
	private String ituch;
	
	private String itunm;
	
	private String finalSn;
	
	private String internalSn;
	
	private String pn;
	
	private String frequency;
	
	private String channelPb2;
	
	private Date createDate;
	
	@Id
    @Index(name="idx_product_archive_id")
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@Column
    @Index(name="idx_product_archive_finalsn")
	public String getFinalSn() {
		return finalSn;
	}

	public void setFinalSn(String finalSn) {
		this.finalSn = finalSn;
	}

	@Column
    @Index(name="idx_product_archive_internalsn")
	public String getInternalSn() {
		return internalSn;
	}

	public void setInternalSn(String internalSn) {
		this.internalSn = internalSn;
	}

	@Column
	public String getPn() {
		return pn;
	}

	public void setPn(String pn) {
		this.pn = pn;
	}

	@Column
	public String getFrequency() {
		return frequency;
	}

	public void setFrequency(String frequency) {
		this.frequency = frequency;
	}

	@Column
	public String getChannelPb2() {
		return channelPb2;
	}

	public void setChannelPb2(String channelPb2) {
		this.channelPb2 = channelPb2;
	}

	@Column
    @Index(name="idx_product_archive_processid")
	public String getProcessId() {
		return processId;
	}

	public void setProcessId(String processId) {
		this.processId = processId;
	}
	
    @Basic(optional=false)
	@Column
    @Index(name="idx_product_archive_status")
	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}
	
	@Column
    @Index(name="idx_product_archive_lockedby")
	public String getLockedBy() {
		return lockedBy;
	}

	public void setLockedBy(String lockedBy) {
		this.lockedBy = lockedBy;
	}

	@Column
    @Index(name="idx_product_archive_lot")
	public String getLot() {
		return lot;
	}

	public void setLot(String lot) {
		this.lot = lot;
	}

	@Column
	public String getWono() {
		return wono;
	}

	public void setWono(String wono) {
		this.wono = wono;
	}

	@Column
	public String getItuch() {
		return ituch;
	}

	public void setItuch(String ituch) {
		this.ituch = ituch;
	}
	
	@Column
	public String getItunm() {
		return itunm;
	}

	public void setItunm(String itunm) {
		this.itunm = itunm;
	}

	@Column
	public Date getCreateDate() {
		return createDate;
	}

	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "TEMPLATEID")
	public Template getTemplate() {
		return template;
	}

	public void setTemplate(Template template) {
		this.template = template;
	}

	@Column
	public Long getStepSpecId() {
		return stepSpecId;
	}

	public void setStepSpecId(Long stepSpecId) {
		this.stepSpecId = stepSpecId;
	}

	@Transient
	public StepSpec getStepSpec() {
		return stepSpec;
	}

	public void setStepSpec(StepSpec stepSpec) {
		this.stepSpec = stepSpec;
	}

}
